Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separation of attribute definitions from attribute usages: HTTP #208

Merged
merged 7 commits into from
Oct 9, 2023

Conversation

AlexanderWert
Copy link
Member

@AlexanderWert AlexanderWert commented Jul 25, 2023

This PR demonstrates how changes will look like when refactoring semantic conventions model files for the purpose of separating attribute definitions from attribute usages in concrete semantic conventions.

The changes here:

  • All http.* attributes are defined under /model/registry/http.yaml. Here, all attributes are defined as opt_in.
  • All usages of those attributes only reference the attributes and overwrite the requirement level to keep the original requirement level at the place of usage.
  • Changes in the markdown files (through table generation) are limited to:
    • adding links to the attributes registry for the individual attributes
    • (because of the way markdown table generation works) the order of attributes (and corresponding notes) changes (which is better because it's in an alphabetical order)
  • There's a new section in the markdown docs attributes-dictionary/* that is the place to list all the available attributes in one place, grouped by the namespace (here: only http.md so far).

@Oberon00
Copy link
Member

Oberon00 commented Jul 25, 2023

Here, all attributes are defined as opt_in.

I think this is a bit weird. Probably we'd want a specific requirement type like "needs-to-be-defind-on-usage-or-error". Otherwise I'd stay with "recommended" as default, since that is the one with the fewest requirements (opt-in requires you to either not implement it or provide some explicit configuration option if you implement it; recommended requires no implementation, but if you implement it you can do so w/o configuration option)

@AlexanderWert
Copy link
Member Author

Here, all attributes are defined as opt_in.

I think this is a bit weird. Probably we'd want a specific requirement type like "needs-to-be-defind-on-usage-or-error". Otherwise I'd stay with "recommended" as default, since that is the one with the fewest requirements (opt-in requires you to either not implement it or provide some explicit configuration option if you implement it; recommended requires no implementation, but if you implement it you can do so w/o configuration option)

Agree with that! Also see my comment here: #197 (comment)

I just think we could do it in a second step.

@Oberon00
Copy link
Member

Then, why use opt-in in the first step instead of the default?

@AlexanderWert
Copy link
Member Author

Then, why use opt-in in the first step instead of the default?

I'm also fine with leaving the default (recommended). We just should make sure later on that the requirement level is not being rendered in the dictionary page (because there it does not make sense).

Similar, to https://opentelemetry.io/docs/specs/semconv/url/url/, where requirement-level doesn't make any sense.

@AlexanderWert AlexanderWert force-pushed the registry-http branch 2 times, most recently from 940e2c7 to ec69e1e Compare July 25, 2023 14:52
@AlexanderWert AlexanderWert changed the title Demonstrating separation of attribute definitions from attribute usages Separation of attribute definitions from attribute usages: HTTP Aug 9, 2023
@AlexanderWert AlexanderWert marked this pull request as ready for review August 9, 2023 06:58
@AlexanderWert AlexanderWert requested review from a team August 9, 2023 06:58
@AlexanderWert
Copy link
Member Author

@open-telemetry/specs-semconv-approvers As discussed in this week's semconv WG, this is the first PR to start refactoring yaml files as described in Step1 of this proposal.

Please also have a look at open-telemetry/build-tools#190, which would help with rendering the registry pages properly (without the requirement level column in the tables).

Copy link
Member

@joaopgrassi joaopgrassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks pretty good!

docs/attributes-dictionary/README.md Outdated Show resolved Hide resolved
docs/attributes-dictionary/http.md Outdated Show resolved Hide resolved
docs/attributes-dictionary/README.md Outdated Show resolved Hide resolved
docs/attributes-dictionary/http.md Outdated Show resolved Hide resolved
@AlexanderWert
Copy link
Member Author

AlexanderWert commented Aug 29, 2023

@open-telemetry/specs-semconv-approvers Can I get another round of reviews for this? Thanks!

docs/attributes-registry/README.md Outdated Show resolved Hide resolved
docs/attributes-registry/README.md Outdated Show resolved Hide resolved
docs/attributes-registry/README.md Outdated Show resolved Hide resolved
@AlexanderWert
Copy link
Member Author

Added the usage of omit_requirement_level. Now, the registry table doesn't show the requirement level column anymore.

@open-telemetry/specs-semconv-approvers, @open-telemetry/specs-semconv-maintainers Are we good to proceed with that?

Copy link
Member

@joaopgrassi joaopgrassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably too soon, but I was thinking if the registry would also benefit to follow the same directory structure as we have now in docs. Not blocking, and we can also adapt later.

@AlexanderWert
Copy link
Member Author

It's probably too soon, but I was thinking if the registry would also benefit to follow the same directory structure as we have now in docs. Not blocking, and we can also adapt later.

I think we have different concerns with the semantic conventions structure and the registry structure. In the semantic conventions we group / structure the content by the logical domain (and that often covers attributes from different namespaces). With the registry we provide an overview of all defined attributes. So the attributes should be easy to find by their name. That's why I think a namespace-based structuring is more beneficial for the registry.

@AlexanderWert
Copy link
Member Author

@open-telemetry/specs-semconv-maintainers anything blocking this?

I'd really like to get this in and then move fast with the refactoring (similar to what we did with the markdown files back then).
My hope is that this will accelerate some contributions (i.e. adding new attributes without directly tying them to semantic conventions).

@AlexanderWert
Copy link
Member Author

Conflict resolution depends on open-telemetry/build-tools#206

docs/attributes-registry/README.md Show resolved Hide resolved
docs/attributes-registry/http.md Show resolved Hide resolved
docs/attributes-registry/http.md Show resolved Hide resolved
docs/http/http-metrics.md Outdated Show resolved Hide resolved
AlexanderWert and others added 3 commits October 5, 2023 08:27
Signed-off-by: Alexander Wert <[email protected]>

Update docs/attributes-registry/README.md

Co-authored-by: Joao Grassi <[email protected]>

Update docs/attributes-registry/README.md

Co-authored-by: Joao Grassi <[email protected]>
Copy link
Contributor

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AlexanderWert AlexanderWert merged commit 4040095 into open-telemetry:main Oct 9, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

9 participants